Back to Contents Previous Next
6. Icons
PROCwimp_iconenable(window%,icon%,state%)
Allows an icon to be enabled or disabled (’greyed out’) or toggled from one state to the other.
window% = handle of window containing icon.
icon% = number of icon.
If state%=0 icon will be disabled (greyed out) and will not respond to mouse clicks.
If state%=1 icon will be enabled.
If state%=2 icon will be changed from its existing state to the other.
FNwimp_geticonenable(window%,icon%)
Returns 1 if the icon icon% in the window whose handle
is window% is enabled. Returns 0 if it is disabled(’greyed out’).
PROCwimp_iconselect(window%,icon%,state%)
Allows an icon to be selected or deselected or toggled from one state to the other.
Useful for selecting/deselecting/toggling radio and option icons.
window% = handle of window containing icon.
icon% = number of icon.
If state%=0 icon will be de-selected.
If state%=1 icon will be selected.
If state%=2 icon will be changed from its existing state to the other.
FNwimp_geticonselect(window%,icon%)
Returns 1 if the icon is selected, or 0 if it is not selected.
Useful for reading the state of radio and option icons.
window% = handle of window containing icon.
icon% = number of icon.
PROCwimp_puticontext(window%,icon%,text$)
If the icon is indirected then the text in the icon is replaced with text$.
(For an indirected ‘sprite-only’ icon, the same function is used to change the sprite; in which case text$ is the sprite-name of the required new sprite - which must already be in the Wimp sprite pool.)
If the icon is not indirected then an error is caused.
window% = handle of window containing icon.
icon% = number of icon.
text$ = the required new text (or sprite-name). If text$ exceeds the maximum indirected length specified in the icon definition it will be truncated - which could lead to a ‘sprite not found’ error with a sprite-only icon..
Note: The caret position (if present) will be preserved as far as is possible. If the caret is at the right-hand end of the current text, or if the length of the new text is shorter than the current caret index, then the caret will be placed at the right-hand end of the new text.
FNwimp_geticontext(window%,icon%)
Returns a string containing the text from the icon.
window% = handle of window containing icon.
icon% = icon number.
FNwimp_geticonsize(window%,icon%,side%)
Returns the width/height of an icon, in OS units.
window%= window handle
icon%- icon handle
If side% = 0 width of icon is returned.
If side% = 1 height of icon is returned.
FNwimp_geticonposition(window%,icon%,coord%)
Returns x/y work area OS-unit coordinates of icon sides.
window%= window handle
icon%- icon handle
If coord% = 0 minimum x coord of icon is returned.
If coord% = 1 minimum y coord of icon is returned.
If coord% = 2 maximum x coord of icon is returned.
If coord% = 3 maximum y coord of icon is returned.
PROCwimp_resizeicon(window%,icon%,minx%,miny%,maxx%,maxy%)
Resizes (and/or moves) an existing icon.
window%= window handle
icon%- icon handle
minx%=required new position of left edge of icon in work OS units.
miny%=required new position of bottom edge of icon in work OS units (probably a negative value)
maxx%=required new position of right edge of icon in work OS units.
maxy%=required new position of top edge of icon in work OS units (probably a negative value).
PROCwimp_moveicon(window%,icon%,minx%,miny%)
Moves an existing icon (without changing its size).
window%= window handle
icon%- icon handle
minx%=required new position of left edge of icon in work OS units.
miny%=required new position of bottom edge of icon in work OS units (probably a negative value).
FNwimp_iconbar(spritename$,text$,maxlen%,pos%)
Creates and places an icon on the iconbar.
spritename$ = name of sprite to put on iconbar.
text$ = text to put underneath the icon.
If text$ = “” then ‘sprite-only’ icon will be created and maxlen% will be ignored.
If text$ is any other string then an indirected ‘text-plus-sprite’ icon will be created, with space available for a maximum of maxlen% characters (+terminator). (If maxlen% is less than length of text$ then maxlen% will be made equal to length of text$.)
If pos% = 1 then the icon will appear on the right of iconbar.
If pos% = 0 then it will appear on the left.
Returns the iconbar window handle (i.e. always -2).
PROCwimp_colouricon(window%,icon%,colour%,background%)
Sets colour of text/background/border in an icon to colour%.
window% = handle of window containing icon.
icon% = number of icon.
colour% = colour in range 0-15.
background% = 0 to change text (and border, if present) colour.
background% = 1 to change background colour (if icon is ‘filled’).
(See Section 2.33 for conditions needed for colour change in icons using outline fonts.)
PROCwimp_puticonfont(window%,icon%,fonthandle%)
Changes font of icon text to the font and size specified by fonthandle%. (Icon must have been defined as using outline fonts.)
window% = handle of window containing icon.
icon% = number of icon.
fonthandle% = handle of required font.
Note: The caret position (if present) will be preserved.
PROCwimp_iconbit(window%,icon%,bit%,state%)
Ensures a specific bit of an icon’s ‘icon flags’ is set to the
specified state - or toggled from one state to the other.
window% = handle of window containing icon.
icon% = number of icon.
bit% = number of icon flags bit to set/unset or toggle.
If state%=0 the specified bit will be set.
If state%=1 the specified bit will be unset.
If state%=2 the specified bit will be changed from its existing state to the other.
Note that if ‘bit%’ is set to 23, no action will take place. Use PROCwimp_iconhide() instead.
FNwimp_geticonbit(window%,icon%,bit%)
Returns state of a specific bit of an icon’s ‘icon flags’.
Return is 1 if bit is set, or 0 if unset.
window% = handle of window containing icon.
icon% = number of icon.
bit% = icon flags bit to test (0-31).
PROCwimp_putcaret(window%,icon%,index%)
Puts the caret in the icon and gives window input focus. If there is text in the icon the caret position can be placed more precisely using index%
window% =handle of window containing icon.
icon% = number of icon (or set to -1 if caret not wanted in icon)
index% = required position of caret within icon text. (If index% is set to -1 or to a value greater than the length of the current text then the caret will be placed at the right-hand end of the text.)
PROCwimp_losecaret
Removes the caret from the icon it is in - and removes input focus
from the window.
FNwimp_getcaretposition(choice%)
Returns information about current caret location/position.
If choice% = 0 handle of window with caret is returned.
If choice% = 1 handle of icon with caret is returned.
If choice% = 2 work area OS-unit x position (in window carrying caret) is returned.
If choice% = 3 work area OS-unit y position (in window carrying caret) is returned.
If choice% = 4 the position of the caret (the ‘index’) within the text of a writable icon is returned.
Return is -1 in cases where the caret is not present.
PROCwimp_puticonbartext(text$)
If the iconbar icon has indirected text underneath it then it is
replaced by text$. (The length of text$ must not exceed the iconbar’s defined max. indirected text length.)
PROCwimp_iconbarsprite(spritename$)
Changes the sprite used for the iconbar icon.
spritename$= name of required sprite, which must already be in Wimp sprite pool.
PROCwimp_putsliderpcent(window%,icon%,pcent)
Sets the percentage of the slider. If the icon is not a
slider then this is ignored.
window% = handle of window with slider in.
icon% = icon number of slider.
pcent = percentage to set. Can be integer or floating point number,
but must be in the range 0-100.
FNwimp_getsliderpcent(window%,icon%)
Returns the percentage of the slider. If the icon is not
a slider then 0 is returned.
The number returned is a floating point number in the
range 0-100.
window% = handle of window with slider in.
icon% = icon number of slider.
FNwimp_createicon(window%,wminx%,wminy%,wmaxx%,wmaxy%,flag-s%,esg%,button%,fcol%,bcol%,font%,text$,sprname$,sarea%,maxind%,-valid$)
Creates an icon and returns its handle (icon number).
window% = handle of window to create icon in.
wminx%,wminy%,wmaxx%,wmaxy% are bottom left and top
right corners of icon in work area OS coordinates.
flags% = number representing flags for icon.
esg% = esg number of icon. 0 for icons which aren’t radio buttons.
button% = button type of icon.
fcol%,bcol% = foreground and background colours of icons (if not using outline font) in desktop colours, so both in the range 0-15.
font% = handle of outline font. 0 if not using a font.
text$ = text for icon.
sprname$ = sprite name for icon.
sarea% = handle of sprite area, or 0 to use Wimp sprite area.
maxind% = if icon is indirected then maximum size.
valid$ = icon validation string.
(See Section 2.23 of Manual for details of flags%, button%, etc.)
PROCwimp_ploticon(wminx%,wminy%,wmaxx%,wmaxy%,flags%,esg%,-button%,fcol%,bcol%,font%,text$,sprname$,sarea%,maxind%,valid$)
Defines and plots an icon directly into a redraw window. (The plotting will be into the window currently being redrawn.)
wminx%,wminy%,wmaxx%,wmaxy% are bottom left and top
right corners of icon in work area OS coordinates.
flags% = number representing flags for icon.
esg% = esg number of icon. 0 for icons which aren’t radio buttons.
button% = button type of icon.
fcol%,bcol% = foreground and background colours of icons (if not using outline font) in desktop colours, so both in the range 0-15.
font% = handle of outline font. 0 if not using a font.
text$ = text for icon.
sprname$ = sprite name for icon.
sarea% = handle of sprite area, or 0 to use Wimp sprite area.
maxind% = if icon is indirected then maximum size.
valid$ = icon validation string.
(See Section 2.23 of Manual for details of flags%, button%, etc.)
PROCwimp_deleteicon(window%,icon%,redraw%)
Deletes an icon definition from a window.
The icon will not disappear until the next redraw - which can be forced using third parameter.
window% = handle of window containing the icon.
icon% = icon number of icon to delete.
If redraw% is 1 then the window is redrawn.
If redraw% is 0 then it isn’t and the icon won’t disappear immediately.
PROCwimp_iconhide(window%,icon%,state%)
Hides/shows an existing icon - and toggles between the two states.
window% = handle of window containing the icon.
icon% = icon number of icon to hide/show or toggle.
If state%=0 the icon is made to appear (show).
If state%=1 the icon is made to disappear (hide).
If state%=2 the icon is toggled between hide/show.
PROCwimp_copydraggedicon()
NOT IN DrWimp LIBRARY.
ONLY USED AS PART OF ‘Elixir_02’ for copying a dragged icon - see Manual Section 2.36 and 3.16.
Needs to be used with PROCuser_endicondrag().
PROCwimp_nudgeinteger()
NOT IN DrWimp LIBRARY.
PART OF ‘Elixir_05’ providing optional wimp-functions for managing ‘nudger’/’bump’ icons - see Manual Section 2.36 and 3.16.
For managing a pair of ‘nudger’/’bump’ icons using integer numbers.. (Intended to be used within PROCuser_mouseclick().)
PROCwimp_nudgereal()
NOT IN DrWimp LIBRARY.
PART OF ‘Elixir_05’ providing optional wimp-functions for managing ‘nudger’/’bump’ icons - see Manual Section 2.36 and 3.16.
For managing a pair of ‘nudger’/’bump’ icons using real numbers.. (Intended to be used within PROCuser_mouseclick().)
PROCwimp_group(handle%,type%,string$,state%)
NOT IN DrWimp LIBRARY.
ONLY USED AS PART OF ‘Elixir_07’ - see Manual Section 2.36 and 3.16.
Top of page Back to Contents Previous Next